using System;
using System.IO;
using System.Text;

namespace WindowsFormsApplication1
{


	public class QRSTeste
	{

		public QRSTeste ()
		{
		}
		
		public static void realizaTeste(String arquivo)
		{
		Bdac bdac = new Bdac();
		QrsFilt filt = new QrsFilt();
		bdac.ResetBDAC();
			
		int inter = 0;
		StreamReader reader = new StreamReader(arquivo);
		int cont = 0;
			while(!reader.EndOfStream)
			{
				
				try{
				int amostra = int.Parse(reader.ReadLine());
               	int fDatum = filt.filter(amostra);
				int delay = bdac.BeatDetect(fDatum,1);
   				if (delay!= 0)
                {
					 	cont++;				
				}
				}catch{;}
			}
		
		Console.Write("\n"+cont);
		}
	}
}
